package com.tepth.remote.control.delegate.apply.examination;

import com.tepth.remote.control.base.mvp.BaseModel;
import com.tepth.remote.control.base.mvp.BasePresenter;
import com.tepth.remote.control.base.mvp.BaseView;
import com.tepth.remote.core.net.callback.IError;
import com.tepth.remote.core.net.callback.ISoapSuccess;

import java.util.WeakHashMap;

/**
 * Description:
 *
 * @author Hequn.Lee
 * @date 2018/11/23
 */
public interface ExaminationContract {

    interface View extends BaseView {
        /**
         * 审批成功
         *
         * @param type 审批类型
         */
        void examinationSuccess(int type);

        /**
         * 审批失败
         *
         * @param code 错误码
         * @param msg  错误信息
         */
        void examinationFailed(int code, String msg);
    }

    interface Model extends BaseModel {
        /**
         * 审批
         *
         * @param params     参数集合
         * @param methodName 方法名
         * @param nameSpace  命名空间
         * @param success    成功回调
         * @param error      错误回调
         */
        void onExamination(WeakHashMap<String, Object> params,
                           String methodName,
                           String nameSpace,
                           ISoapSuccess success,
                           IError error);
    }

    abstract class AbstractPresenter extends BasePresenter {

        /**
         * 审批
         *
         * @param id       id
         * @param targetId targetId
         * @param type     类型 ：1同意，2拒绝
         * @param reason   审批意见
         */
        abstract void onExamination(int id, int targetId, int type, String reason);
    }
}
